package yto.freemarker.springbootstudy.rabbitmq;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import yto.freemarker.springbootstudy.entity.User;

/**
 * 用户消费者
 *
 * @author dongxing
 * @create 2018-05-02 10:25
 **/

@Component
@RabbitListener(queues = "user")
public class UserReceiver {
    @RabbitHandler
    public void process(User user) {
        System.out.println("user receive  : " + user.getName()+"/"+user.getAge());
    }

}
